import React from "react"
import { Card, Button } from 'antd';
import { BrowserRouter as Router, Route, Switch, Link } from "react-router-dom";
import Book from './components/Book'
// 子组件
import JavaBook from './components/JavaBook'
import WEBBook from './components/WEBBook'
const Router07 = (props) => {
    return (
        <Card title="路由嵌套" bordered={false}>
            <div>

                <Router>
                    <Link to="/router/router07/webbook">  <Button className="margin_right_sm" type="primary">webbook</Button></Link>
                    <Link to="/router/router07/javabook">  <Button className="margin_right_sm" type="danger">javabook</Button></Link>
                    <Book>
                        <Switch>
                            <Route path="/router/router07/webbook" component={WEBBook}></Route>
                            <Route path="/router/router07/javabook" component={JavaBook}></Route>
                        </Switch>
                    </Book>
                </Router>
            </div>
        </Card>
    )
}
export default Router07 